// 骑手相关类型定义

// 车辆类型
export type VehicleType = 'BIKE' | 'MOTORBIKE' | 'ELECTRIC';

// 工作状态类型
export type WorkStatus = 'ONLINE' | 'OFFLINE' | 'BUSY';

// 时间范围类型
export type TimeRange = 'day' | 'week' | 'month';

// 订单状态类型
export type OrderStatus = 'PENDING' | 'ACCEPTED' | 'PICKED_UP' | 'DELIVERING' | 'DELIVERED' | 'CANCELLED';

// 骑手登录数据类型
export interface RiderLoginData {
  username: string;
  password: string;
}

// 骑手注册数据类型
export interface RiderRegisterData {
  realName: string;
  idCard: string;
  idCardFront: string;
  idCardBack: string;
  vehicleType: VehicleType;
  vehicleNumber: string;
  password: string;
}

// 位置更新数据类型
export interface LocationUpdateData {
  latitude: number;
  longitude: number;
  orderId?: string;
  timestamp?: string;
}

// 骑手基本信息
export interface RiderInfo {
  id: string;
  username: string;
  realName: string;
  phone: string;
  idCard: string;
  vehicleType: VehicleType;
  vehicleNumber: string;
  workStatus: WorkStatus;
  rating: number;
  totalOrders: number;
  avatar?: string;
}

// 骑手订单信息
export interface RiderOrder {
  id: string;
  orderNumber: string;
  customerId: string;
  customerName: string;
  customerPhone: string;
  storeId: string;
  storeName: string;
  storeAddress: string;
  deliveryAddress: string;
  orderStatus: OrderStatus;
  totalAmount: number;
  deliveryFee: number;
  estimatedTime: number;
  actualDeliveryTime?: number;
  pickupTime?: string;
  deliveryTime?: string;
  createdAt: string;
  updatedAt: string;
}

// 骑手收入统计
export interface RiderEarnings {
  todayEarnings: number;
  weekEarnings: number;
  monthEarnings: number;
  totalEarnings: number;
  todayOrders: number;
  weekOrders: number;
  monthOrders: number;
  totalOrders: number;
}

// 骑手统计数据
export interface RiderStats {
  earnings: RiderEarnings;
  onlineTime: number;
  averageDeliveryTime: number;
  customerRating: number;
  completionRate: number;
}

// API响应类型
export interface RiderApiResponse<T = any> {
  status: number;
  message: string;
  data: T;
}

// 分页参数
export interface PageParams {
  page: number;
  pageSize: number;
}

// 分页结果
export interface PageResult<T> {
  data: T[];
  total: number;
  page: number;
  pageSize: number;
  totalPages: number;
}
